﻿/*==============================================================
 * ArticleMapping.cs
 * Copyright (C) 2014 贵州惠众互联 Inc. All rights reserved.
 *==============================================================
 * Author:   罗应红
 * Date:     2014/02/28 15:49:53.
 * Version:  1.0
 * QQ:		 88962800
*==============================================================*/

using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using QDT.Core.Domain;

namespace QDT.Core.MSData.Mapping {
    public class ArticleMapping:EntityTypeConfiguration<Article> {
        public ArticleMapping() {
            HasKey(o => o.ID);
            Property(o => o.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            HasRequired(o => o.Cate).WithMany().HasForeignKey(o => o.CateId);
            Property(o => o.CateId).HasColumnName("cate_id");
            Property(o => o.CreateTime).HasColumnName("create_time");
            Property(o => o.UpdateTime).HasColumnName("update_time");
            Property(o => o.AddAdminId).HasColumnName("add_admin_id");
            Property(o => o.UpdateAdminId).HasColumnName("update_admin_id");
            Property(o => o.IsEffect).HasColumnName("is_effect");
            Property(o => o.RelUrl).HasColumnName("rel_url");
            Property(o => o.ClickCount).HasColumnName("click_count");
            Property(o => o.IsDelete).HasColumnName("is_delete");
            Property(o => o.SeoTitle).HasColumnName("seo_title");
            Property(o => o.SeoKeyWord).HasColumnName("seo_keyword");
            Property(o => o.SubTitle).HasColumnName("sub_title");
            Property(o => o.SeoDescription).HasColumnName("seo_description");
            ToTable(DB.TPref("article"));
        }
    }
}